<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>员工管理</title>
<link rel="stylesheet" type="text/css" href="ui/themes/default/easyui.css"></link>
<link rel="stylesheet" type="text/css" href="ui/themes/icon.css"></link>
<script type="text/javascript" src="ui/jquery.min.js"></script>
<script type="text/javascript" src="ui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="ui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="ui/jquery.serializejson.min.js"></script>
<script type="text/javascript" src="ui/date.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="ui/download.js"></script>
<script type="text/javascript" src="js/crud.js"></script>
<script type="text/javascript">
    var name="emp";
    height=340;
    
    var columns=[[
            {field:'uuid',title:'编号',width:100},
            {field:'username',title:'登陆名',width:100},
            {field:'name',title:'真实姓名',width:100},
            {field:'gender',title:'性别',width:100,formatter:function(value){
                if(value * 1 == 1){ // 类型强转
                    return '男';
                }
                if(value * 1 == 0){
                    return '女';
                }
            }},
            {field:'email',title:'邮件地址',width:100},
            {field:'tele',title:'联系电话',width:100},
            {field:'address',title:'联系地址',width:100},
            {field:'birthday',title:'出生年月日',width:100,formatter:formatDate},
            {field:'dep',title:'部门',width:100,formatter:function(value){
                if(value){ // value代表着dep对象
                    return value.name
                }
            }},

            {field:'-',title:'操作',width:100,formatter: function(value,row,index){
                var oper = "<a href=\"javascript:void(0)\" onclick=\"edit(" + row.uuid + ')">修改</a>';
                oper += ' <a href="javascript:void(0)" onclick="del(' + row.uuid + ')">删除</a>';
                return oper;
            }}
        ]];

</script>
</head>
<body>
<div class="easyui-panel" style="padding-left:4px;border-bottom:0px;">
    <div style="height:2px;"></div>
    <form id="searchForm">
        登陆名：<input name="t1.username" >
真实姓名：<input name="t1.name" >
性别：<input type="radio" name="t1.gender" value="1">男  <input type="radio" name="t1.gender" value="0">女
<div style="height:2px;"></div>
邮件地址：<input name="t1.email" >
联系电话：<input name="t1.tele" >
联系地址：<input name="t1.address" >
<div style="height:2px;"></div>
出生年月日：<input name="t1.birthday" class="easyui-datebox"> -> <input name="t2.birthday" class="easyui-datebox">
部门：<input name="t1.dep.uuid"  class="easyui-combobox" data-options="
        valueField:'uuid',textField:'name',url:'dep!list.action'
    ">
<button type="button" id="btnSearch">查询</button>
    </form>
    <div style="height:2px;"></div>
</div>
<table id="grid"></table>

<div id="editDlg" style="padding:8px;">
    <form id="editForm">
        <input name="t.uuid" type="hidden"> 
        <table>
            <tr>
                <td>登陆名</td><td><input name="t.username" class="easyui-validatebox" data-options="required:true,missingMessage:'登陆名不能为空'" > </td>
            </tr>
            <tr>
                <td>真实姓名</td><td><input name="t.name"> </td>
            </tr>
            <tr>
                <td>性别</td>
                <td>
                    <input type="radio" name="t.gender" value="1">男 
                    <input type="radio" name="t.gender" value="0">女
                </td>
            </tr>
            <tr>
                <td>邮件地址</td><td><input name="t.email" class="easyui-validatebox" data-options="
                    validType:'email',
                    invalidMessage:'邮件地址格式不正确，如：abc@qq.com'
                "> </td>
            </tr>
            <tr>
                <td>联系电话</td><td><input name="t.tele"> </td>
            </tr>
            <tr>
                <td>联系地址</td><td><input name="t.address"> </td>
            </tr>
            <tr>
                <td>出生年月日</td><td><input name="t.birthday" class="easyui-datebox" data-options="editable:false,required:true"> </td>
            </tr>
            <tr>
                <td>部门编号</td><td><input name="t.dep.uuid" class="easyui-combobox" data-options="
                    valueField:'uuid',textField:'name',url:'dep!list.action',required:true
                "> </td>
            </tr>
        </table>
    </form>
</div>

<!-- 导入窗口 -->
<div id="doImportDlg" style="padding:2px;">
    <form id="doImportForm" enctype="multipart/form-data">
        导入文件：<input type="file" name="file">
    </form>
</div>
</body>
</html>
